//
// Created by Castle-Moriarty on 2025/11/2.
//
#include <iostream>
using namespace std;

const double* find_max_address(const double scores[],size_t count) {
    size_t max_index{};
    double max{};

    for (size_t i{0};i < count;i++) {
        if (scores[i] > max) {
            max = scores[i];
            max_index = i;
        }
    }
    return &scores[max_index];
}


int main() {
    double array[]{1.0,2.0,3.0,4.0,33.33,34.2,89.09,22.1};
    const double* p_max = find_max_address(array,size(array));
    cout << "max value in array: " << *p_max << endl;


    return 0;
}